package edu.zsc.logic;


import edu.zsc.ElevatorConfig;

import java.util.Map;

public class Algorithm {

    private static Algorithm INSTANT = new Algorithm();
    private Callback callback;

    private Algorithm() {
        this.callback = new NullCallback();
    }

    public static Algorithm getInstance() {
        return INSTANT;
    }

    public void setCallback(Callback callback) {
        this.callback = callback;
    }

    public interface Callback {

        /**
         * 用于完成Command计算后的回调
         *
         * @param target 目标楼层
         */
        void onCommandCompleted(int target);
    }


    /**
     * key : 各电梯号
     * value ： 电梯号对应的电梯的上一次状态
     */
    private Map<Character, InputMessage> prevMessage;


    /**
     * 当电梯状态发生改变的时候被调用
     *
     * @param inputMessage 电梯状态值
     */
    public void handleElevatorStateChange(InputMessage inputMessage) {

    }

}
